.class public abstract Lcom/glympse/platform/common/GTimer;
.super Lcom/glympse/platform/GRunnable;
.source "GTimer.java"


# instance fields
.field m_fRunning:Z

.field m_lInterval:J


# direct methods
.method public constructor <init>(J)V
    .locals 2
    .parameter "lInterval"

    .prologue
    .line 23
    invoke-direct {p0}, Lcom/glympse/platform/GRunnable;-><init>()V

    .line 19
    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/glympse/platform/common/GTimer;->m_lInterval:J

    .line 20
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/glympse/platform/common/GTimer;->m_fRunning:Z

    .line 25
    iput-wide p1, p0, Lcom/glympse/platform/common/GTimer;->m_lInterval:J

    .line 26
    return-void
.end method


# virtual methods
.method public abstract OnTimer()V
.end method

.method public Run()V
    .locals 3

    .prologue
    .line 31
    iget-boolean v0, p0, Lcom/glympse/platform/common/GTimer;->m_fRunning:Z

    if-eqz v0, :cond_0

    .line 33
    invoke-virtual {p0}, Lcom/glympse/platform/common/GTimer;->OnTimer()V

    .line 34
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    iget-wide v1, p0, Lcom/glympse/platform/common/GTimer;->m_lInterval:J

    invoke-virtual {v0, p0, v1, v2}, Lcom/glympse/platform/Platform;->PostToMainThreadDelayed(Lcom/glympse/platform/GRunnable;J)Z

    .line 36
    :cond_0
    return-void
.end method

.method public Start()V
    .locals 1

    .prologue
    .line 41
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/glympse/platform/common/GTimer;->Start(Z)V

    .line 42
    return-void
.end method

.method public Start(Z)V
    .locals 3
    .parameter "fRunNow"

    .prologue
    .line 47
    invoke-virtual {p0}, Lcom/glympse/platform/common/GTimer;->Stop()V

    .line 49
    iget-boolean v0, p0, Lcom/glympse/platform/common/GTimer;->m_fRunning:Z

    if-nez v0, :cond_0

    .line 51
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/glympse/platform/common/GTimer;->m_fRunning:Z

    .line 53
    if-eqz p1, :cond_1

    .line 55
    invoke-virtual {p0}, Lcom/glympse/platform/common/GTimer;->Run()V

    .line 62
    :cond_0
    :goto_0
    return-void

    .line 59
    :cond_1
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    iget-wide v1, p0, Lcom/glympse/platform/common/GTimer;->m_lInterval:J

    invoke-virtual {v0, p0, v1, v2}, Lcom/glympse/platform/Platform;->PostToMainThreadDelayed(Lcom/glympse/platform/GRunnable;J)Z

    goto :goto_0
.end method

.method public Stop()V
    .locals 1

    .prologue
    .line 67
    iget-boolean v0, p0, Lcom/glympse/platform/common/GTimer;->m_fRunning:Z

    if-eqz v0, :cond_0

    .line 69
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/glympse/platform/common/GTimer;->m_fRunning:Z

    .line 70
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    invoke-virtual {v0, p0}, Lcom/glympse/platform/Platform;->CancelPost(Lcom/glympse/platform/GRunnable;)V

    .line 72
    :cond_0
    return-void
.end method
